package com.ydche.model;

import com.ydche.util.MyTime;

import java.util.Date;

public class Carprofile {

    private Long id;
    private Long ownerId;
    private String licenseNo;
    private String cityPlate;
    private String frameNo;
    private String engineNo;
    private int modelId;
    private Date registerDate;
    private Byte specialcarflag;
    private Date specialcardate;
    private Date createtime;
    private Date lastupdateddatetime;
    private Long createUserId;
    private String drivingLicenseFace;
    private String drivingLicenseBack;
    private Date issuelicensedate;

    public Carprofile(){
         this.createtime = new Date();
         this.lastupdateddatetime = this.getCreatetime();
    }

    public Carprofile(Long userId, Long customerId, String licenseNo, String vinNo, String engineNo, String registerDate, byte isTran,
                      String transDate, Integer modelId){
        this.ownerId=customerId;
        this.licenseNo=licenseNo;
        this.cityPlate=licenseNo.substring(0,2);
        this.frameNo=vinNo;
        this.engineNo=engineNo;
        if (modelId !=null){
            this.modelId = modelId.intValue();
        }
        this.registerDate = MyTime.transToDate(registerDate);
        this.specialcarflag = isTran;
        if (isTran == 1){
            this.specialcardate = MyTime.transToDate(transDate);
        }
        this.createtime = new Date();
        this.lastupdateddatetime = this.getCreatetime();
        this.createUserId = userId;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getOwnerId() {
        return ownerId;
    }

    public void setOwnerId(Long ownerId) {
        this.ownerId = ownerId;
    }

    public String getLicenseNo() {
        return licenseNo;
    }

    public void setLicenseNo(String licenseNo) {
        this.licenseNo = licenseNo;
    }

    public String getCityPlate() {
        return cityPlate;
    }

    public void setCityPlate(String cityPlate) {
        this.cityPlate = cityPlate;
    }

    public String getFrameNo() {
        return frameNo;
    }

    public void setFrameNo(String frameNo) {
        this.frameNo = frameNo;
    }

    public String getEngineNo() {
        return engineNo;
    }

    public void setEngineNo(String engineNo) {
        this.engineNo = engineNo;
    }

    public int getModelId() {
        return modelId;
    }

    public void setModelId(int modelId) {
        this.modelId = modelId;
    }

    public Date getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(Date registerDate) {
        this.registerDate = registerDate;
    }

    public Byte getSpecialcarflag() {
        return specialcarflag;
    }

    public void setSpecialcarflag(Byte specialcarflag) {
        this.specialcarflag = specialcarflag;
    }

    public Date getSpecialcardate() {
        return specialcardate;
    }

    public void setSpecialcardate(Date specialcardate) {
        this.specialcardate = specialcardate;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Date getLastupdateddatetime() {
        return lastupdateddatetime;
    }

    public void setLastupdateddatetime(Date lastupdateddatetime) {
        this.lastupdateddatetime = lastupdateddatetime;
    }

    public Long getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public String getDrivingLicenseFace() {
        return drivingLicenseFace;
    }

    public void setDrivingLicenseFace(String drivingLicenseFace) {
        this.drivingLicenseFace = drivingLicenseFace;
    }

    public String getDrivingLicenseBack() {
        return drivingLicenseBack;
    }

    public void setDrivingLicenseBack(String drivingLicenseBack) {
        this.drivingLicenseBack = drivingLicenseBack;
    }

    public Date getIssuelicensedate() {
        return issuelicensedate;
    }

    public void setIssuelicensedate(Date issuelicensedate) {
        this.issuelicensedate = issuelicensedate;
    }
}
